package com.ly.pj.module.controller;

import com.ly.pj.module.pojo.RequestParammaster;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class ParamObjectController {//直接量接收请求参数，参数必须和请求参数相同
    @RequestMapping("/doMethod1")
    public String doMethod(String name){
        return "request params"+name;
    }
    @RequestMapping("/doMethod2")
    public String doMethod(RequestParammaster param){//pojo对象接收请求参数，pojo对象中必须提供对应的get方法
        return "request params "+param.toString();
    }
    @RequestMapping("/doMethod3")
    public String doMethod(@RequestParam Map<String,Object> param){//Map接收请求参数是前面必须加@RequestParam注解对参数进行描述
        return "request params "+param.toString();
    }
}
